# include "MonitorTextureDrawAble.h"
# include "IndexBufferBindAble.h"
# include "VertexBufferBindAble.h"
# include "VertexScalBufferBindAble.h"
# include "VertexShaderBindAble.h"
# include "PixelShaderBindAble.h"
# include "AnisotropicSamplerBindAble.h"

MonitorTextureDrawAble::MonitorTextureDrawAble(MyDx11* _myDx11, int _width, int _height): TextureDrawAble(_myDx11, _width, _height, true)
{
	ID3D11Device* _device = this->getDevice(_myDx11);

	// 顶点缓存
	const Vertex vertices[] = {
		{-1,	1,	0,	0,	0},
		{1,		1,	0,	1,	0},
		{1,		-1,	0,	1,	1},
		{-1,	-1,	0,	0,	1},
	};
	this->insertBindAble(new VertexBufferBindAble(_device, vertices, sizeof(vertices)));

	// 缩放矩阵
	this->insertBindAble(new VertexScalBufferBindAble(_device, { 0.0f, 0.0f, 0.0f }, {1.0f, 1.0f, 1.0f}));

	// 顶点索引
	const UINT16 indices[] = {
		0,1,2, 0,2,3
	};
	this->insertBindAble(new IndexBufferBindAble(_device, indices, sizeof(indices)));
	this->m_index_size = sizeof(indices) / sizeof(UINT16);

	// 顶点着色器
	this->insertBindAble(new VertexShaderBindAble(_device));

	// 像素着色器
	this->insertBindAble(new PixelShaderBindAble(_device));

	// 采样器
	this->insertBindAble(new AnisotropicSamplerBindAble(_device));
}

MonitorTextureDrawAble::~MonitorTextureDrawAble()
{

}
